// SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
// SPDX-License-Identifier: GPL-3.0-only

package main

import (
	"fmt"
	"os"

	"gitcode.com/openseaotter/so_server/cmds"
	"gitcode.com/openseaotter/so_server/cmds/auth_cmd"
	"gitcode.com/openseaotter/so_server/cmds/config_cmd"
	"gitcode.com/openseaotter/so_server/cmds/group_cmd"
	"gitcode.com/openseaotter/so_server/cmds/image_cmd"
	"gitcode.com/openseaotter/so_server/cmds/service_cmd"
	"gitcode.com/openseaotter/so_server/cmds/watch_cmd"
	"github.com/spf13/cobra"
)

const (
	VERSION = "0.1.2"
)

var versionCmd = &cobra.Command{
	Use: "version",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("OpenSeaOtter version", VERSION)
	},
}

func main() {
	var rootCmd = &cobra.Command{}
	rootCmd.AddCommand(config_cmd.ConfigCmd, service_cmd.ServiceCmd, auth_cmd.AuthCmd, group_cmd.GroupCmd, image_cmd.ImageCmd, watch_cmd.WatchCmd,
		versionCmd, cmds.GcCmd)
	if err := rootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}
